package com.gitee.melin.bee.core.jdbc.dialect.phoenix;

import com.gitee.melin.bee.core.jdbc.relational.ConnectionInfo;
import com.gitee.melin.bee.core.jdbc.enums.DataSourceType;
import com.gitee.melin.bee.core.jdbc.dialect.DataTypeConvertor;
import com.gitee.melin.bee.core.jdbc.dialect.mysql.MySqlTypeConvertor;
import com.gitee.melin.bee.core.jdbc.dialect.AbstractJdbcDialect;
import com.gitee.melin.bee.core.jdbc.dialect.IDBQuery;
import com.gitee.melin.bee.core.jdbc.dialect.oracle.OracleQuery;

import java.sql.Connection;
import java.sql.Driver;

public class PhoenixJdbcDialect extends AbstractJdbcDialect {

    @Override
    public DataSourceType getDataSourceType() {
        return DataSourceType.PHOENIX;
    }

    public PhoenixJdbcDialect(ConnectionInfo connectionInfo) {
        super(connectionInfo);
    }

    public PhoenixJdbcDialect(Connection connection) {
        super(connection);
    }

    @Override
    protected IDBQuery getDBQuery() {
        return new OracleQuery();
    }

    @Override
    protected DataTypeConvertor getTypeConvert() {
        return new MySqlTypeConvertor();
    }

    @Override
    protected Driver getDriver() {
        return loadDriver(DataSourceType.PHOENIX.getDriverClass());
    }

    @Override
    protected String getDDLColumnName() {
        return "";
    }
}
